package com.renting.common.persistence;

import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
import org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy;

/**
 * Linux下Mysql 区分大小写 这里把表名转换成大写解决
 */
public class SqlUpperCaseStrategy extends SpringPhysicalNamingStrategy {


    @Override
    public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment context) {
        // 将表名全部转换成大写
        String tableName = name.getText().toUpperCase();
        return name.toIdentifier(tableName);
    }


}
